#ifndef ANIMATION_H
#define ANIMATION_H
#include <allegro.h>
#include <time.h>
struct AnimationFrame
{
    BITMAP *sprite;
    AnimationFrame *next;
};
class Animation
{
    public:
        int w, h;
        void LoadFrames(const char *filename, int fw, int fh, int numFrames);
        void play();
        void stop();
        void update();
        BITMAP *getCurrentFrame();
        bool running;
        Animation();
        int frames;
        float animationSpeed;
        clock_t lastUpdate;
        void flipp();
        bool flipped;
        bool finished;
    private:

        AnimationFrame *CurrentFrame;
        AnimationFrame *FirstFrame;
};

#endif // ANIMATION_H
